package com.srs.backend.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Orders {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer clientId;
    private Integer clientNum;
    private Integer tableId;
    private Integer status;
    private Integer serverId;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date finishTime;
    private String remark;
    // 实际收款金额
    private Double totalMoney;
    private Integer isPredetermine;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date predetermineTime;

    // 账单总金额
    private transient double sum;

    public Orders(Integer id, Integer clientId, Integer clientNum, Integer tableId, Integer status, Integer serverId, Date createTime, Date finishTime, String remark, Double totalMoney, Integer isPredetermine, Date predetermineTime) {
        this.id = id;
        this.clientId = clientId;
        this.clientNum = clientNum;
        this.tableId = tableId;
        this.status = status;
        this.serverId = serverId;
        this.createTime = createTime;
        this.finishTime = finishTime;
        this.remark = remark;
        this.totalMoney = totalMoney;
        this.isPredetermine = isPredetermine;
        this.predetermineTime = predetermineTime;
    }
}
